package io.zhifei.common.utils;

import com.baidubce.services.cdn.model.logmodel.LogEntry;
import io.zhifei.modules.sys.system.entity.SysLogEntity;

import javax.servlet.http.HttpServletRequest;

public class LogUtil {

    public static SysLogEntity structureLog(HttpServletRequest httpServletRequest ) {
        SysLogEntity logEntry = new SysLogEntity();
        logEntry.setMethod(httpServletRequest.getMethod());
        logEntry.setOperation(httpServletRequest.getRequestURI());
        logEntry.setParams(httpServletRequest.getQueryString());
        logEntry.setIp(httpServletRequest.getRemoteAddr());
        return logEntry;
    }
}
